Public Class FormUI

    Private Sub LabelX1_Click(sender As Object, e As EventArgs)
        Me.Close()

    End Sub

    Private Sub lblMaximize_Click(sender As Object, e As EventArgs)
        If Me.WindowState = FormWindowState.Normal = False Then

            Me.WindowState = FormWindowState.Normal
        Else

            Me.WindowState = FormWindowState.Maximized



        End If
    End Sub

    Private Sub Timer1_Tick(sender As Object, e As EventArgs)
        lblShowTime.Text = Now.ToLongTimeString  
    End Sub

    Private Sub FormEmployee_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Me.lblMinimize.Hide()
        PermissionMenus()
        lblPicUser.ForeColor = Color.White

        UI.SetPlaceHolder(Me.txtSearch, "Search here...")
        lblUser.Text = App.UserFullName
        lblUser.ForeColor = Color.White
        lblShowTime.ForeColor = Color.White
        lblShowDate.ForeColor = Color.White
        lblShowDate.Text = (Now.ToLongDateString)


    End Sub




    Public Sub PermissionMenus()
     
        '=============================================================================
        
        Me.menuManage.Enabled = App.IsAuthorized(Permissions.Manage)
        Me.menuEmployee.Enabled = App.IsAuthorized(Permissions.Manage_Employee)
        Me.menuEducation.Enabled = App.IsAuthorized(Permissions.Manage_Education)
        Me.menuExperience.Enabled = App.IsAuthorized(Permissions.Manage_Experience)
        Me.menuFamilies.Enabled = App.IsAuthorized(Permissions.Manage_Family)
        Me.menuDepartment.Enabled = App.IsAuthorized(Permissions.Manage_Department)
        Me.menuPosition.Enabled = App.IsAuthorized(Permissions.Manage_permission)
        Me.menuLeaveTime.Enabled = App.IsAuthorized(Permissions.Manage_LeaveTime)
        Me.menuResign.Enabled = App.IsAuthorized(Permissions.Manage_Resign)
        Me.menuAccident.Enabled = App.IsAuthorized(Permissions.Manage_Accident)
        Me.menuInsurance.Enabled = App.IsAuthorized(Permissions.Manage_Insurance)
        Me.menuWarning.Enabled = App.IsAuthorized(Permissions.Manage_Warning)
        Me.menuWorkPerformance.Enabled = App.IsAuthorized(Permissions.Manage_WorkPerformance)

        Me.TrainingMenu.Enabled = App.IsAuthorized(Permissions.Training)
        Me.menuCompanyTraining.Enabled = App.IsAuthorized(Permissions.Training_CompanyTraining)
        Me.menuTrainee.Enabled = App.IsAuthorized(Permissions.Training_Trainee)
        Me.menuTraineeExperience.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Experience)
        Me.menuTraineeEducation.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Education)
        Me.menuTraineeFamilies.Enabled = App.IsAuthorized(Permissions.Training_Trainee_Family)
        Me.MenuSkill.Enabled = App.IsAuthorized(Permissions.Training_Skill)

        '====================================================================================
        

    End Sub

    Private Sub LabelX1_Click_1(sender As Object, e As EventArgs) Handles LabelX1.Click
        Me.Text = 0
        Me.Close()
    End Sub

    Private Sub lblMaximize_Click_1(sender As Object, e As EventArgs)
        If Me.WindowState = FormWindowState.Normal = False Then
            Me.WindowState = FormWindowState.Normal
        Else
            Me.WindowState = FormWindowState.Maximized
        End If
    End Sub

    Private Sub Timer1_Tick_1(sender As Object, e As EventArgs) Handles Timer1.Tick
        lblShowTime.Text = Now.ToLongTimeString
    End Sub

    Private Sub txtSearch_KeyDown(sender As Object, e As KeyEventArgs) Handles txtSearch.KeyDown

    End Sub

    Private Sub txtSearch_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtSearch.KeyPress

    End Sub

    Private Sub txtSearch_TextChanged(sender As Object, e As EventArgs) Handles txtSearch.TextChanged

    End Sub

    Private Sub menuEmployee_Click(sender As Object, e As EventArgs) Handles menuEmployee.Click

        FormEmployee.Show()
    End Sub

    Private Sub lblMinimize_Click(sender As Object, e As EventArgs) Handles lblMinimize.Click
        Me.WindowState = FormWindowState.Minimized
    End Sub

    Private Sub ChangToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ChangToolStripMenuItem.Click
        Dim frm = New FormChangePassword()
        frm.txtUserName.Text = Me.lblUser.Text
        frm.ShowDialog()
    End Sub

    Private Sub LogOutToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LogOutToolStripMenuItem.Click
        Application.Restart()
    End Sub

    Private Sub ExitToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles ExitToolStripMenuItem.Click
        Application.Exit()
    End Sub

    Private Sub menuEducation_Click(sender As Object, e As EventArgs) Handles menuEducation.Click

        FormEducation.Show()
    End Sub

    Private Sub menuExperience_Click(sender As Object, e As EventArgs) Handles menuExperience.Click

        FormExperience.Show()
    End Sub

    Private Sub menuFamilies_Click(sender As Object, e As EventArgs) Handles menuFamilies.Click
        FormFamilies.Show()
    End Sub

    Private Sub menuDepartment_Click(sender As Object, e As EventArgs) Handles menuDepartment.Click
        FormDepartments.Show()
    End Sub

    Private Sub menuPosition_Click(sender As Object, e As EventArgs) Handles menuPosition.Click
        FormPermission.Show()
    End Sub

    Private Sub menuLeaveTime_Click(sender As Object, e As EventArgs) Handles menuLeaveTime.Click
        FormLeaveTime.Show()
    End Sub

    Private Sub menuResign_Click(sender As Object, e As EventArgs) Handles menuResign.Click
        FormResign.Show()
    End Sub

    Private Sub menuAccident_Click(sender As Object, e As EventArgs) Handles menuAccident.Click
        FormAccident.Show()
    End Sub

    Private Sub menuInsurance_Click(sender As Object, e As EventArgs) Handles menuInsurance.Click
        FormInsurance.Show()
    End Sub

    Private Sub menuWarning_Click(sender As Object, e As EventArgs) Handles menuWarning.Click
        FormWarning.Show()
    End Sub

    Private Sub menuWorkPerformance_Click(sender As Object, e As EventArgs) Handles menuWorkPerformance.Click
        FormWorkPerformace.Show()
    End Sub

    Private Sub menuCompanyTraining_Click(sender As Object, e As EventArgs) Handles menuCompanyTraining.Click
        FormCompanryTraining.Show()
    End Sub

    Private Sub menuTrainee_Click(sender As Object, e As EventArgs) Handles menuTrainee.Click
        FormTrainee.Show()
    End Sub

    Private Sub menuTraineeExperience_Click(sender As Object, e As EventArgs) Handles menuTraineeExperience.Click
        FormTraineeExperience.Show()
    End Sub

    Private Sub menuTraineeEducation_Click(sender As Object, e As EventArgs) Handles menuTraineeEducation.Click
        FormTraineeEducation.Show()
    End Sub

    Private Sub menuTraineeFamilies_Click(sender As Object, e As EventArgs) Handles menuTraineeFamilies.Click
        FormTraineeFamilies.Show()
    End Sub

    Private Sub MenuSkill_Click(sender As Object, e As EventArgs) Handles MenuSkill.Click
        FormTraineeSkill.Show()
    End Sub

    Private Sub TraineeTrainingToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles TraineeTrainingToolStripMenuItem.Click
        FormTraineeTraining.Show()
    End Sub

    Private Sub TrainingToolStripMenuItem1_Click(sender As Object, e As EventArgs) Handles TrainingToolStripMenuItem1.Click
        FormTrainning.Show()
    End Sub

    Private Sub InterviewToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles InterviewToolStripMenuItem.Click
        FormInterview.Show()
    End Sub

    Private Sub UserToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles UserToolStripMenuItem.Click
        FormUser.Show()
    End Sub

    Private Sub GroupMenuToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles GroupMenuToolStripMenuItem.Click
        FormRole.Show()
    End Sub

    Private Sub BackupDatabaseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles BackupDatabaseToolStripMenuItem.Click
        FormBackupDatabase.Show()
    End Sub
End Class